home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8905 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.xnet.com!news-admin
  2. From: kd9fb@xnet.com (Peter Mikalajunas)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: [Q] functions returning structures
  5. Date: Thu, 07 Mar 1996 05:11:08 GMT
  6. Organization: XNet - A Full Service Internet Provider - (708) 983-6064
  7. Message-ID: <4hlqtb$6un@flood.xnet.com>
  8. References: <4hasjj$opf@decaxp.harvard.edu> <4hcn9u$9fo@inet-nntp-gw-1.us.oracle.com>
  9. NNTP-Posting-Host: monsoon.xnet.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. wkaufman@wkaufman.us.oracle.com (William Kaufman) wrote:
  13. >In article <4hasjj$opf@decaxp.harvard.edu> martino@course2.harvard.edu (Carlo Martino) writes:
  14.  
  15. >]  I have been programming in
  16. >] C for upwards of 6 years, and only recently did I hear something to the effect
  17. >] that structures returned by functions have a tendency to be corrupted.
  18.  
  19. >    I've never seen that happen on a compiler that supported structure
  20. >passing.  Maybe the structure wasn't defined or function declared
  21. >properly: try turning your compiler's warnings all the way up--maybe
  22. >there wasn't a structure definition and the compiler pretended it was an
  23. >int,...
  24.  
  25. I have seen compilers that insist on padding structures.  Usually, if
  26. they are well behaved they will warn of the fact.  DEC C comes 
  27. to mind in this regard.  Take a good look at the man page to see
  28. if there is switch that will force it to either warn you or not use 
  29. such behaviour.
  30.  
  31.  
  32. kd9fb@xnet.com
  33. http://www.xnet.com/~kd9fb
  34.  
  35.